//
//  LXNewFeatureViewController.m
//  微博
//
//  Created by imera on 15/9/18.
//  Copyright (c) 2015年 imera. All rights reserved.
//

#import "LXNewFeatureViewController.h"
#import "LXSliderView.h"

#define LXNewFeatureCount 3

@interface LXNewFeatureViewController()<UIScrollViewDelegate>
@property (nonatomic, weak) UIPageControl *pageControl;
@end

@implementation LXNewFeatureViewController

- (void)viewDidLoad
{
    //设置背景颜色
    self.view.backgroundColor = LXColor(246, 246, 246);
    
    //添加scrollview
    LXSliderView *sliderView = [[LXSliderView alloc] initWithFirstImage:@"new_feature_1" imageCount:3];
    sliderView.delegate = self;
    self.pageControl = sliderView.pageControl;
    [self.view addSubview:sliderView];
    //添加pagecontrol
    [self.view addSubview:sliderView.pageControl];
}

#pragma mark scrollview的代理方法
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    int currentPage = (scrollView.contentOffset.x / self.view.frame.size.width) + 0.5;
    self.pageControl.currentPage = currentPage;
}


@end
